from selenium.webdriver.common.by import By

class ProductManagementLocator:

    "20240416添加"
    product_search = (By.XPATH,'//*[text()="Search"]/..')

    # 等待转圈 [class="antd4-spin-dot antd4-spin-dot-spin"]
    wait = (By.CSS_SELECTOR, '[class="antd4-spin-dot antd4-spin-dot-spin"]')

    #初始页面展开的tab
    default_page_expanded=(By.CSS_SELECTOR,'[aria-expanded="true"]')
    # 点击myresource菜单
    click_myresource = (By.CSS_SELECTOR, '[path="/work_bench/myResource"]')
    # 点击order management
    click_order_management = (By.XPATH, "(//div[contains(@data-menu-id,'ORDER_CST')])")

    #prod_managent_tab
    prod_managent_tab=(By.XPATH,"//div[contains(@data-menu-id,'PRODUCT_MANAGEMENT_CRE_PLT')]")

    #test_tab
    test_tab=(By.CSS_SELECTOR,'[path="/console/exportRecords"]')

    #prod_category_tab
    prod_category_tab=(By.CSS_SELECTOR,'[path="/console/product/category"]')

    #marketplace_category
    marketplace_category_tab=(By.CSS_SELECTOR,'[path="/console/product/marketplaceCategory"]')

    #loading_wait
    loading_wait=(By.CSS_SELECTOR,'[class="antd4-spin-dot antd4-spin-dot-spin"]')

    #category_add_button
    category_add_button=(By.XPATH,"//div[contains(@class,'catalog-name-title')]//a")

    #my_resource_tab
    my_resource_tab=(By.CSS_SELECTOR,'[path="/work_bench/myResource"]')

    #resource_package
    resource_package=(By.CSS_SELECTOR,'[path="/work_bench/resource/packages"]')

    #category_name
    category_name=(By.CSS_SELECTOR,'[id="catalogName"]')

    #category_icon
    category_icon=(By.CSS_SELECTOR,'[type="file"]')

    # 确认按钮
    public_confirm_button = (By.XPATH, "//div[contains(@class,'modal-footer')]/button[2]")

    #marketplace_confirm_button
    marketplace_confirm_button=(By.XPATH,"//div[contains(@class,'modal-confirm-btns')]/button[2]")

    #操作提示
    opreation_prompt=(By.XPATH,"//div[contains(@class,'antd4-message-success')]")

    #category_name_input
    category_name_input=(By.CSS_SELECTOR,'[placeholder="Category Name"]')

    #查询类别名称
    category_query_button=(By.XPATH,"(//button[contains(@class,'search-button')])[1]")

    #category_list
    category_list=(By.XPATH,"//div[contains(@class,'catalog-name__')]")

    #action下拉列表
    action_list=(By.XPATH,"//button[contains(@class,'dropdown-trigger')]")

    #delete删除
    action_delete=(By.XPATH,"//li[contains(@data-menu-id,'delete')]/span")

    #operations
    operation_type=(By.XPATH,'//span[contains(@class,"antd4-dropdown-menu-title-content")]')

    #product_create_button
    product_create_button=(By.CSS_SELECTOR,'[class="table-tool"]>div>button')

    #prod_default_name
    prod_default_name=(By.XPATH,'//input[@id="productOfferId"]/..')

    #prod_default_name_list
    options=(By.CSS_SELECTOR,'[class="antd4-select-item-option-content"]')

    #productSpecialOfferUrlAddress
    prod_special_offer_url_address=(By.CSS_SELECTOR,'[id="productSpecialOfferUrlAddress"]')

    #termsConditionsUrlAddress
    prod_conditions_offer_url_address=(By.CSS_SELECTOR,'[id="termsConditionsUrlAddress"]')

    #创建产品确认按钮
    create_prod_button_confirm=(By.XPATH,'//div[contains(@class,"space-align-center btn")]//button[@class="antd4-btn antd4-btn-primary"]')

    #region_id_select
    region_id_select=(By.XPATH,"//div[contains(@class,'select-multiple')]")

    #select_all_button
    region_options=(By.CSS_SELECTOR,'[class="antd4-select-item antd4-select-item-option"]')

    #prod_console_url
    prod_console_url=(By.CSS_SELECTOR,'[id="productDetailInfo_0_urlAddress"]')

    #prod_action
    prod_actions=(By.CSS_SELECTOR,'[aria-label="ellipsis"]')

    #prod_delete_confirm
    prod_delete_confirm=(By.XPATH,"//button[contains(@class,'dangerou')]")

    #prod_display_name
    prod_display_name=(By.CSS_SELECTOR,'[id="offerName"]')

    #mian_menu
    mian_menu=(By.CSS_SELECTOR,'[class="product-menu-tigger"]')

    #products_list
    prioduct_list=(By.XPATH,"//div[contains(@class,'columnItemName')]")

    #prod_name_input
    prod_name_input=(By.CSS_SELECTOR,'[placeholder="Product Name"]')

    #prod_search_button
    prod_search_button=(By.XPATH,"(//button[contains(@class,'search-button')])[2]")

    #price_plan_btn
    price_plan_btn=(By.XPATH,"//button[contains(@class,'btn-link actions-btn')]")

    #price_plan_edit
    price_plan_edit=(By.XPATH,"//div[contains(@class,'buttons')]/button")

    #1_level_menu_name_input
    level_menu_name_input=(By.CSS_SELECTOR,'[id="basic_categoryName"]')

    #market_category_list
    market_category_list=(By.XPATH,"//span[contains(@class,'tree-node-content-wrapper-normal')]")

    #market_category_action
    market_category_action=(By.CSS_SELECTOR,'[class="anticon anticon-ellipsis"]')

    #menu_name_input
    menu_name_input=(By.CSS_SELECTOR,'[id="basic_categoryName"]')

    #page_total
    page_total=(By.CSS_SELECTOR,'[class="antd4-pagination-total-text"]')

    #resources
    resources=(By.CSS_SELECTOR,'[class="antd4-tabs-tab-btn"]')

    #cerate_new_tab
    #cerate_new_tab=(By.XPATH,"//div[contains(@class,'tabs-tabpane-active')]//div[@class='antd4-space-item'][1]//button")
    cerate_new_tab=(By.XPATH,"(//div[contains(@class,'tabs-tabpane-active')]//div[@class='antd4-space-item' or @class='antd4-form-item-control-input-content'])[1]//button")

    #prod_list
    prod_list=(By.XPATH,'//div[@class="antd4-popover popover-contain___1wdXb antd4-popover-placement-bottomLeft "]/div/div[2]//div[contains(@class,"productBtn")]')

    #times_of_service
    term_of_service=(By.CSS_SELECTOR,'[class="antd4-checkbox"]')

    #buy_now_button
    buy_now_button=(By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-primary"]')

    #pay_button
    pay_button=(By.XPATH,"//button[contains(@class,'footerBtn')]")

    #pay_successful
    pay_successful=(By.XPATH, '//*[text()="Payment Successful"]')
    release_successful = (By.XPATH, '//*[text()="Release Successfully"]')

    #resource_modify_button
    resource_modify_button=(By.XPATH,'(//button[@class="antd4-btn antd4-btn-link table-operation-btnLine-btn"])[2]')

    #renew_button
    renew_button=(By.XPATH,'//div[@class="antd4-tabs-content antd4-tabs-content-top"]/div[1]//table//div[@class="table-operation"]//button')


    #disk_renew_button
    disk_renew_button=(By.XPATH,'//div[@class="antd4-tabs-content antd4-tabs-content-top"]/div[3]//table//div[@class="table-operation"]//button')


    #resource_renew_button
    resource_renew_button=(By.XPATH,'//tbody[@class="antd4-table-tbody"]/tr[2]/td[14]//div[@class="table-operation-btnLine"]/div[1]/button')

    #enable_auto
    enable_auto=(By.XPATH,'(//td[@class="antd4-table-cell"])[13]')

    #TEST
    test=(By.CSS_SELECTOR,'[class="antd4-switch-inner"]')

    #menu_list
    menu_list=(By.CSS_SELECTOR,'[class="product-menu-tigger"]')

    #resources_list
    resources_list=(By.XPATH,"(//div[contains(@class,'menuOverFlowGroup')]/div[5]/div/div)[2]")

    #pay_as_you_go_button
    pay_as_you_go_button=(By.CSS_SELECTOR,'[id="creForm_billingMethod"]>div>:nth-child(2)>div>label>:nth-child(2)')

    #detail_element
    detail_element=(By.XPATH,"//div[contains(@class,'helpItemVal')]")

    #view_detail
    view_detail=(By.XPATH,"//span[contains(@class,'handleText')]")

    #total_amount
    total_amount=(By.XPATH,"//span[contains(@class,'orderCostsMoney')]")

    #check_order_button
    check_order_button=(By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-default"]')

    #order_view_detail_button
    order_view_detail_button=(By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-link table-operation-btnLine-btn"]')

    #order_details
    order_details=(By.XPATH,"//div[contains(@class,'fontNowrap')]")

    #reset_button
    reset_button=(By.XPATH,'//div[@class="antd4-tabs-content antd4-tabs-content-top"]/div[3]//button[@class="antd4-btn antd4-btn-default"]')

    #action_button
    my_resource_action_button=(By.XPATH,'//div[@class="antd4-tabs-content antd4-tabs-content-top"]/div[3]//table//div[@class="table-operation"]//div[@class="antd4-dropdown-trigger table-operation-omit"]/span')


    #action_button
    action_button=(By.CSS_SELECTOR,'[class="anticon anticon-ellipsis table-operation-ellipsis"]')

    #action_list
    my_resource_action_list=(By.CSS_SELECTOR,'[class="antd4-dropdown-menu-title-content"]')

    #capaity_input
    capaity_input=(By.CSS_SELECTOR,'[id="creForm_capacity"]')

    #release_button
    release_button=(By.XPATH,"//button[contains(@class,'btn-lg releaseBtn')]")

    #ecs_select
    ecs_select=(By.XPATH,'//input[@id="rc_select_3"]/..')

    #ecs_option
    ecs_option=(By.CSS_SELECTOR,'[class="antd4-select-item-option-content"]')

    #instance_name
    instance_name_input=(By.CSS_SELECTOR,'[id="creForm_instanceName"]')

    #cpu_select
    cpu_select=(By.XPATH,'//input[@id="rc_select_2"]/..')

    #cpu_option
    cpu_option=(By.XPATH,"//div[@id='rc_select_2_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #image_1_select
    image_1_select=(By.XPATH,'//input[@id="rc_select_4"]/..')

    #image_1_options
    image_1_options=(By.XPATH,"//div[@id='rc_select_4_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #image_2_select
    image_2_select=(By.XPATH,'//input[@id="rc_select_3"]/..')

    #image_2_options
    image_2_options=(By.XPATH,"//div[@id='rc_select_3_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #image_3_select
    image_3_select=(By.XPATH,'//input[@id="rc_select_0"]/..')

    #deployment_set_select
    deployment_set_select=(By.XPATH,'//input[@id="rc_select_6"]/..')

    #deployment_set_option
    deployment_set_option=(By.XPATH,"//div[@id='rc_select_6_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #deployment_set2_select
    deployment_set2_select=(By.XPATH,'//input[@id="rc_select_5"]/..')

    #deployment_set2_option
    deployment_set2_option=(By.XPATH,"//div[@id='rc_select_5_list']/../div[2]//div[@class='antd4-select-item-option-content']")


    #vpc_select
    vpc_select=(By.XPATH,'//input[@id="rc_select_9"]/..')

    # vpc_option
    vpc_option = (By.XPATH, "//div[@id='rc_select_9_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #vpc2_select
    vpc2_select=(By.XPATH,'//input[@id="rc_select_8"]/..')

    # vpc_option
    vpc2_option = (By.XPATH, "//div[@id='rc_select_8_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #switch_select
    switch_select=(By.XPATH,'//input[@id="rc_select_12"]/..')

    # switch_option
    switch_option=(By.XPATH, "//div[@id='rc_select_12_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #switch2_select
    switch2_select=(By.XPATH,'//input[@id="rc_select_11"]/..')

    # switch_option
    switch2_option=(By.XPATH, "//div[@id='rc_select_11_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #security_group_select
    security_group_select=(By.XPATH,'//input[@id="rc_select_10"]/..')

    #security_group_option
    security_group_option=(By.XPATH,"//div[@id='rc_select_10_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #security_group2_select
    security_group2_select=(By.XPATH,'//input[@id="rc_select_9"]/..')

    #security_group_option
    security_group2_option=(By.XPATH,"//div[@id='rc_select_9_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #login_password_input
    login_password_input=(By.CSS_SELECTOR,'[id="creForm_loginPassword"]')

    #confirm_password_input
    confirm_password_input=(By.CSS_SELECTOR,'[id="creForm_password"]')

    #ecs_instances_tab
    ecs_instances_tab=(By.CSS_SELECTOR,'[displaytext="ECS Instances"]')

    #status
    status=(By.CSS_SELECTOR,'[class="teamix-pro-field-ellipsis "]>div')

    #iframe
    iframe=(By.CSS_SELECTOR,'[id="hj_container"]')

    #refresh_button
    refresh_button=(By.XPATH,"(//span[contains(@class,'refresh')])[1]")

    #console_instance_name_input
    console_instance_name_input=(By.XPATH,'(//input[@placeholder="Search by instance name"])[1]')

    #console_search_button
    console_search_button=(By.XPATH,"//span[contains(@class,'addonAfter')]")

    #intance_status
    intance_status=(By.CSS_SELECTOR,'[class="next-btn next-medium next-btn-primary next-btn-text next-menu-btn"]')

    #stop_instance
    stop_instance=(By.CSS_SELECTOR,'[data-teamix-spm="undefined-__teamix_pro_action_key_2"]')

    #stop_instance_confirm
    stop_instance_confirm=(By.CSS_SELECTOR,'[class="next-btn next-medium next-btn-primary next-btn-warning next-dialog-btn"]')

    #delete_instance
    delete_instance=(By.CSS_SELECTOR,'[data-teamix-spm="undefined-__teamix_pro_action_key_3"]')

    #instance_id_ele
    instance_id_ele=(By.XPATH,'//tr[@class="next-table-row first last"]/td[2]//span[@class="teamix-pro-field-output-bold"]')

    #instance_id_input
    instance_id_input=(By.CSS_SELECTOR,'[id="instanceId"]')

    #instance_id_search
    instance_id_search=(By.XPATH,'//div[@id="rc-tabs-0-panel-ALL"]//form/div/div[5]//button')

    #instance_family
    instance_family=(By.CSS_SELECTOR,'[class="antd4-radio"]')

    #billing_method_change
    billing_method_change=(By.XPATH,'//tr[@class="antd4-table-row antd4-table-row-level-0"]/td[4]//span')

    # billing_method_change_buy_now
    billing_method_change_buy_now=(By.XPATH,'//div[@class="cre-container-footer cre-container-footer-primaryOperation"]//button')

    #change_org_to_input
    change_org_to_input=(By.CSS_SELECTOR,'[id="targetOrgCode"]')

    #choose_org_name
    def choose_org_name(self,org_name):
        choose_org_name=(By.CSS_SELECTOR,'[title="%s"]'%org_name)
        return choose_org_name

    #change_org_submit_button
    change_org_submit_button=(By.CSS_SELECTOR,'[class="antd4-modal-footer"]>:nth-child(2)')

    #success_prompt
    success_prompt=(By.CSS_SELECTOR,'[class="antd4-message-notice-content"]')

    #free_trial
    free_trial=(By.XPATH,"//div[contains(@class,'dropdown-trigger freeTrial')]/div[2]//span")

    #disk_instance_id
    disk_instance_id=(By.XPATH,'//div[@class="antd4-tabs-tabpane antd4-tabs-tabpane-active"]//tbody[@class="antd4-table-tbody"]/tr[2]/td[1]//a')

    #change_the_operating_system
    change_the_operating_system=(By.CSS_SELECTOR,'[class="cre-page-container-header-panel-title cre-page-container-header-panel-title-default"]>div')

    #gross_amount
    gross_amount_ele=(By.XPATH,"//div[contains(@class,'rightPanel')]/div/div[2]/div/div/div[1]/span[2]")

    #total_to_pay_ele
    total_to_pay_ele=(By.XPATH,"//span[contains(@class,'orderCostsMoney')]")

    #product_name_input
    product_name_input=(By.CSS_SELECTOR,'[placeholder="Product Name"]')

    #search_prod_ele
    search_prod_ele=(By.XPATH,"//div[contains(@class,'menuOverFlowGroup')]/div[5]/div/div[2]")

    #instance_category
    instance_category=(By.CSS_SELECTOR,'[id="category"]>div>div>label>span+span')

    #instance_family
    instance_familys=(By.CSS_SELECTOR,'[class="antd4-radio-wrapper antd4-radio-wrapper-in-form-item"]')

    #total_disk
    total_disk=(By.XPATH,"//div[contains(@class,'tip-text')]/span[2]/span")

    #custom_image_type
    custom_image_type=(By.XPATH,'//form[@id="creForm"]/div[2]/div[2]/div[3]/div[2]//div[@class="antd4-space-item"][2]')

    #delete_disk
    delete_disk=(By.XPATH,"//div[contains(@class,'dataDiskItem_wrapper_')]/div[1]/div[2]//input")


